home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 November: Tool Chest / Dev.CD Nov 98 TC.toast / Tool Chest / Development Kits / MPW etc. / MPW-PR / Interfaces&Libraries / Interfaces / RIncludes / SIOW.h next >
Encoding:
C/C++ Source or Header  |  1997-12-05  |  6.9 KB  |  205 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2. #    SIOW.h
  3. #    Simple Inpue/Output Window header
  4. #    Apple Copyright 1989-1990
  5. #
  6. #    The names for these constants have been selected to satisfy both the
  7. #    standards set up by Apple for applications, and by ANSI for C programming.
  8. #
  9. #-----------------------------------------------------------------------------*/
  10.  
  11. #ifndef __SIOW__
  12. #define __SIOW__
  13.  
  14. #ifndef __kPrefSize
  15. #define __kPrefSize            350        /* Default max app size */
  16. #endif
  17. #ifndef __kMinSize
  18. #define __kMinSize            250        /* Default min app size */
  19. #endif
  20.  
  21. /* The following constants are used to identify menus and their items. */
  22. /* NOTE: resources IDs 20000-20010 are reserved fur use by SIOW */
  23.  
  24. #define    __mApple            20000    /* Apple menu */
  25. #define    __mFile                20001    /* File menu */
  26. #define    __mEdit                20002    /* Edit menu */
  27. #define __mFont                20003    /* Font menu */
  28. #define __mSize                20004    /* Font menu */
  29. #define __mControl            20005    /* Control menu */
  30.  
  31. #define    __rMenuBar            20000    /* application's menu bar */
  32.  
  33. #define    __rAboutAlert        20000    /* about alert */
  34. #define    __rUserAlert        20001    /* user error alert */
  35. #define __rSaveAlert        20002    /* save changes alert -- when quitting is final. */
  36. #define __rQuitAlert        20003    /* quit alert -- when user has a choice. */
  37.  
  38. #define    __rDocWindow        20000    /* application's window */
  39. #define    __rVScroll            20000    /* vertical scrollbar control */
  40. #define    __rHScroll            20001    /* horizontal scrollbar control */
  41. #define    __kErrStrings        20000    /* error string list */
  42. #define __kBalloonStringsResID    20001    /* boolean help string list */
  43.  
  44. #define __rFontPrefStr        20000    /* "Monaco" text for defaut font name */
  45. #define __rResumeMenuText    20001    /* "Resume" text for "Pause" menu item */
  46. #define __rPauseMenuText    20002    /* "Pause" text for "Pause" menu item */
  47. #define __rFinderHelpString    20003    /* balloon help text for icon in finder */
  48.  
  49. #define __rOutfilePrefStr    20004    /* resource for DEFAULT_OUTFILE_NAME */
  50.     /* (only used if SavePref == 2 or 3) */
  51.  
  52. #define __rSavePref            20004
  53.     /* values:  */
  54.     /* 0 = default = DEFAULT_SAVE_PREF, save dialog will remind user to save.     */
  55.     /* 1 = save dialog will not happen, no output will be saved unless user     */
  56.     /*         choose Save or Save As. */
  57.     /* 2 = save dialog will not happen, an output file whose name is             */
  58.     /*        specified by 'STR ' __rOutfilePrefStr will be created to save the     */
  59.     /*        output, replacing any existing file with that name.                 */
  60.     /* note: for option 2, the window title is NOT set to be the filename         */
  61.     /*        specified by 'STR ' __rOutfilePrefStr. If you want it to be the        */
  62.     /*        same, define DEFAULT_WINDOW_NAME to be same as DEFAULT_OUTFILE_NAME.*/
  63.  
  64. #define __rStopPref            20005
  65.     /* values: */
  66.     /* 0 = default = DEFAULT_STOP_PREF, stop dialog will remind user that he    */
  67.     /*        can continue execution.                                             */
  68.     /* 1 = stop dialog will not be shown. If __rSavePref != 0, then the app     */
  69.     /*        exits directly to the Finder, otherwise the app will stay alive        */
  70.     /*        so the user has a chance to save the output.                        */
  71.  
  72. /* The following constants are used to identify menus items. The menu IDs     */
  73. /*   have an "m" prefix and are here for continuity                            */
  74. /*   The item numbers within each menu have an "i" prefix.                     */
  75.  
  76. /* Apple menu */
  77. #define    __iAbout                1
  78.  
  79. /* File menu */
  80. #define    __iNew                    1
  81. #define    __iOpen                    2
  82. #define    __iClose                4
  83. #define __iSave                 5
  84. #define    __iSave_As                6
  85. #define    __iPageSetup            8
  86. #define    __iPrint                9
  87. #define    __iQuit                    11
  88.  
  89. /* Edit menu */
  90. #define    __iUndo                    1
  91. #define    __iCut                    3
  92. #define    __iCopy                    4
  93. #define    __iPaste                5
  94. #define    __iClear                6
  95. #define    __iSelectAll            8
  96.  
  97. /* control menu */
  98.  
  99. #define __iInputEOF                1
  100. #define __iPauseOutput            2
  101. #define __iStop                    3
  102.  
  103. /* The following are indicies into STR# __kErrStrings */
  104.  
  105. #define    __eWrongMachine            1    /* "You must run on 512Ke or later"; */
  106. #define    __eSmallSize            2    /* "Application Memory Size is too small"; */
  107. #define    __eNoMemory                3    /* "Not enough memory to run SIOW"; */
  108. #define    __eNoSpaceCut            4    /* "Not enough memory to do Cut"; */
  109. #define    __eNoCut                5    /* "Cannot do Cut"; */
  110. #define    __eNoCopy                6    /* "Cannot do Copy"; */
  111. #define    __eExceedPaste            7    /* "Cannot exceed 32,000 characters with Paste"; */
  112. #define    __eNoSpacePaste            8    /* "Not enough memory to do Paste"; */
  113. #define    __eNoWindow                9    /* "Cannot create window"; */
  114. #define    __eExceedChar            10    /* "Cannot exceed 32,000 characters"; */
  115. #define    __eNoPaste                11    /* "Cannot do Paste"; */
  116. #define    __eNofont                12    /* "Font not found"; */
  117. #define __eNoInputMoreThanReq    13     /* "Your input was longer than this program was requesting; it will be truncated." */
  118. #define __eDontNeedToSaveAgain    14
  119.  
  120. /* the following are buttons used in __rQuitAlert */
  121.  
  122. #define __kQuitCancelButton        2
  123. #define __kQuitQuitButton        1
  124.  
  125. /* the following are buttons used in __rSaveAlert */
  126.  
  127. #define __kSaveSaveButton        1
  128. #define __kSaveQuitButton        2
  129.  
  130. /* the following are buttons used in __rUserAlert (error) */
  131.  
  132. #define __kUserOKButton            1
  133. #define __kUserStaticText        2
  134. #define __kUserIcon                3
  135.  
  136. /* the following are buttons used in __rAboutAlert */
  137.  
  138. #define __kAboutOKButton        1
  139.  
  140. /* SIOW prefs */
  141.  
  142. /* use -d DEFAULT_FONT_NAME=Geneva (for example) in the rez command-line to override. */
  143.  
  144. #ifndef DEFAULT_FONT_NAME
  145.     #define DEFAULT_FONT_NAME     "Monaco"
  146. #endif
  147.  
  148. /* use -d DEFAULT_FONT_SIZE=12 (for example) in the rez command-line to override.  */
  149.  
  150. #ifndef DEFAULT_FONT_SIZE
  151.     #define DEFAULT_FONT_SIZE     9
  152. #endif
  153.  
  154. /* use -d DEFAULT_WINDOW_NAME=name in the rez command-line to override.  */
  155.  
  156. #ifndef DEFAULT_WINDOW_NAME
  157.     #define DEFAULT_WINDOW_NAME     "untitled"
  158. #endif
  159.  
  160. /* use -d DEFAULT_OUTFILE_NAME=name in the rez command-line to override.  */
  161.     
  162. #ifndef DEFAULT_OUTFILE_NAME    /* see __rSavePref above */
  163.     #define DEFAULT_OUTFILE_NAME    "output"
  164.     /* (only used if SavePref == 2) */
  165. #endif
  166.  
  167. /* use -d DEFAULT_SAVE_PREF=1 (or 2 or 3) in the rez command-line to override.  */
  168.  
  169. #ifndef DEFAULT_SAVE_PREF        /* see __rSavePref above */
  170.     #define DEFAULT_SAVE_PREF    0
  171. #endif
  172.  
  173. /* use -d DEFAULT_STOP_PREF=1 in the rez command-line to override.  */
  174.  
  175. #ifndef DEFAULT_STOP_PREF        /* see __rStopPref above */
  176.     #define DEFAULT_STOP_PREF     0
  177. #endif
  178.  
  179. #ifndef STACK_SIZE
  180. #define STACK_SIZE 4096    
  181. #endif
  182.  
  183. #ifndef REZ
  184.  
  185.     /* The following are “hooks” apps can use to wrestle control from             */
  186.     /* SIOW at critical times. These variabled are defined to NULL in the SIOW     */
  187.     /* library; assign your function pointers to these variables in your         */
  188.     /* code.                                                                    */
  189.  
  190.     extern Boolean (*__siowEventHook)(EventRecord *theEvent);    
  191.         /* User event loop hook -- called when user code is executing             */
  192.         /* a read from stdin. Return true if your hook function has handled     */
  193.         /* the event and wants the SIOW library to ignore the event.             */
  194.  
  195.     extern void (*__siowWindowHook)(WindowPtr theWindow);        
  196.         /* User window is up hook -- called once when output window is created.    */
  197.  
  198.     extern void (*__siowExitHook)(Boolean abort);                
  199.         /* User “exit” hook -- called once when application is quitting.        */
  200.  
  201. #endif
  202.  
  203. #endif
  204.  
  205.